﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using LibHuman;
namespace Human
{
	/// <summary>
	/// Summary description for frmDanhSanhNV.
	/// </summary>
	public class frmDanhSachNV : System.Windows.Forms.Form
	{
        private AccessData mDB = new AccessData();
        string m_user = "",s_bophan="",user_dn="";
		private DataSet ds =new DataSet();
        Language lan = new Language();
		private bool bClear=true;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label label13;
		private System.Windows.Forms.Label label14;
		private System.Windows.Forms.Label label15;
		private System.Windows.Forms.Label label16;
        private System.Windows.Forms.Label label17;
		private System.Windows.Forms.TextBox txbTuoiTu;
        private System.Windows.Forms.CheckBox ckbDang;
		private System.Windows.Forms.CheckBox ckbCongDoan;
		private System.Windows.Forms.CheckBox ckbDoan;
		private System.Windows.Forms.ComboBox cbobGioiTinh;
		private System.Windows.Forms.Button butXemDS;
		private System.Windows.Forms.TextBox txbTuoiDen;
		private System.Windows.Forms.TextBox txbSinhTuThang;
		private System.Windows.Forms.TextBox txbDenThang;
		private System.Windows.Forms.TextBox cbobThamNienCT;
		private System.Windows.Forms.TextBox cbobHeSoLuong;
		private System.Windows.Forms.TextBox cbobHeSoLuongDen;
		private System.Windows.Forms.ComboBox cbobDanToc;
		private System.Windows.Forms.ComboBox cbobTonGiao;
		private System.Windows.Forms.ComboBox cbobThuongTruTai;
		private System.Windows.Forms.ComboBox cbobMaNgach;
		private System.Windows.Forms.ComboBox cbobTrinhDoHocVan;
		private System.Windows.Forms.ComboBox cbobLoaiHD;
		private System.Windows.Forms.ComboBox cbobChuyenMon;
		private System.Windows.Forms.ComboBox cbobTrinhDoNgoaiNgu;
		private System.Windows.Forms.ComboBox cbobBoPhanCongTac;
		private System.Windows.Forms.Button butTiepTuc;
		private System.Windows.Forms.Button butKetThuc;
		private System.Windows.Forms.Button butInDS;
		private System.Windows.Forms.CheckBox checklietsi;
		private System.Windows.Forms.CheckBox checktnxp;
		private System.Windows.Forms.CheckBox checkbdxn;
		private System.Windows.Forms.Label label18;
		private System.Windows.Forms.Label label19;
		private System.Windows.Forms.ComboBox cbotrinhdo;
		private System.Windows.Forms.ComboBox cbochucdanh;
		private System.Windows.Forms.CheckBox checknghiviec;
		private System.Windows.Forms.CheckBox checklamviec;
		private System.Windows.Forms.CheckBox checkrutgon;
        private System.Windows.Forms.CheckBox checkchitiet;
		private System.Windows.Forms.ToolTip toolTip1;
		private System.Windows.Forms.DataGrid dataGrid1;
		private System.Windows.Forms.GroupBox groupBox3;
		private System.Windows.Forms.GroupBox groupBox4;
		private System.Windows.Forms.GroupBox groupBox5;
		private System.Windows.Forms.Label label20;
		private System.Windows.Forms.ComboBox cboVitinh;
		private System.Windows.Forms.Label lblTong;
        private Panel panel1;
		private System.ComponentModel.IContainer components;
        pPrint print1 = null;
        private Button btnexel;
        private ComboBox cbo_chibo;
        private Label label21;
        private ComboBox cbo_loaingach;
        private Label label22;
        private Label label23;
        private ComboBox cbo_nhomngach;
        frmMain2005 f_m;

        public frmDanhSachNV(frmMain2005 f_1,string s_makp,string s_userdn)
		{
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            f_m = f_1;
			if (Screen.PrimaryScreen.WorkingArea.Width>=1000)//
			{
				
				this.WindowState=FormWindowState.Normal;
				this.MaximizeBox=false;
			}
			else
			{
				
				this.WindowState=FormWindowState.Maximized;
			}
            s_bophan = s_makp;
            user_dn = s_userdn;
		}
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDanhSachNV));
            this.label1 = new System.Windows.Forms.Label();
            this.txbTuoiTu = new System.Windows.Forms.TextBox();
            this.ckbDang = new System.Windows.Forms.CheckBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label21 = new System.Windows.Forms.Label();
            this.cbo_chibo = new System.Windows.Forms.ComboBox();
            this.ckbCongDoan = new System.Windows.Forms.CheckBox();
            this.ckbDoan = new System.Windows.Forms.CheckBox();
            this.cbobGioiTinh = new System.Windows.Forms.ComboBox();
            this.butXemDS = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.label11 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.label14 = new System.Windows.Forms.Label();
            this.label15 = new System.Windows.Forms.Label();
            this.label16 = new System.Windows.Forms.Label();
            this.label17 = new System.Windows.Forms.Label();
            this.txbTuoiDen = new System.Windows.Forms.TextBox();
            this.txbSinhTuThang = new System.Windows.Forms.TextBox();
            this.txbDenThang = new System.Windows.Forms.TextBox();
            this.cbobThamNienCT = new System.Windows.Forms.TextBox();
            this.cbobHeSoLuong = new System.Windows.Forms.TextBox();
            this.cbobHeSoLuongDen = new System.Windows.Forms.TextBox();
            this.cbobDanToc = new System.Windows.Forms.ComboBox();
            this.cbobTonGiao = new System.Windows.Forms.ComboBox();
            this.cbobThuongTruTai = new System.Windows.Forms.ComboBox();
            this.cbobMaNgach = new System.Windows.Forms.ComboBox();
            this.cbobTrinhDoHocVan = new System.Windows.Forms.ComboBox();
            this.cbobLoaiHD = new System.Windows.Forms.ComboBox();
            this.cbobChuyenMon = new System.Windows.Forms.ComboBox();
            this.cbobTrinhDoNgoaiNgu = new System.Windows.Forms.ComboBox();
            this.cbobBoPhanCongTac = new System.Windows.Forms.ComboBox();
            this.butTiepTuc = new System.Windows.Forms.Button();
            this.butKetThuc = new System.Windows.Forms.Button();
            this.butInDS = new System.Windows.Forms.Button();
            this.checklietsi = new System.Windows.Forms.CheckBox();
            this.checktnxp = new System.Windows.Forms.CheckBox();
            this.checkbdxn = new System.Windows.Forms.CheckBox();
            this.cbotrinhdo = new System.Windows.Forms.ComboBox();
            this.label18 = new System.Windows.Forms.Label();
            this.cbochucdanh = new System.Windows.Forms.ComboBox();
            this.label19 = new System.Windows.Forms.Label();
            this.checknghiviec = new System.Windows.Forms.CheckBox();
            this.checklamviec = new System.Windows.Forms.CheckBox();
            this.checkrutgon = new System.Windows.Forms.CheckBox();
            this.checkchitiet = new System.Windows.Forms.CheckBox();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.dataGrid1 = new System.Windows.Forms.DataGrid();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.groupBox4 = new System.Windows.Forms.GroupBox();
            this.groupBox5 = new System.Windows.Forms.GroupBox();
            this.label20 = new System.Windows.Forms.Label();
            this.cboVitinh = new System.Windows.Forms.ComboBox();
            this.lblTong = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnexel = new System.Windows.Forms.Button();
            this.cbo_loaingach = new System.Windows.Forms.ComboBox();
            this.label22 = new System.Windows.Forms.Label();
            this.label23 = new System.Windows.Forms.Label();
            this.cbo_nhomngach = new System.Windows.Forms.ComboBox();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
            this.groupBox3.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Location = new System.Drawing.Point(30, 10);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(59, 13);
            this.label1.TabIndex = 19;
            this.label1.Text = "Độ tuổi từ:";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txbTuoiTu
            // 
            this.txbTuoiTu.Location = new System.Drawing.Point(91, 6);
            this.txbTuoiTu.MaxLength = 2;
            this.txbTuoiTu.Name = "txbTuoiTu";
            this.txbTuoiTu.Size = new System.Drawing.Size(36, 20);
            this.txbTuoiTu.TabIndex = 0;
            this.txbTuoiTu.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txbTuoiTu_KeyPress);
            this.txbTuoiTu.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txbTuoiTu_KeyDown);
            // 
            // ckbDang
            // 
            this.ckbDang.Location = new System.Drawing.Point(15, 13);
            this.ckbDang.Name = "ckbDang";
            this.ckbDang.Size = new System.Drawing.Size(62, 24);
            this.ckbDang.TabIndex = 0;
            this.ckbDang.Text = "Đảng";
            this.ckbDang.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.ckbDang.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ckbDang_KeyDown);
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label21);
            this.groupBox1.Controls.Add(this.cbo_chibo);
            this.groupBox1.Controls.Add(this.ckbDang);
            this.groupBox1.Controls.Add(this.ckbCongDoan);
            this.groupBox1.Controls.Add(this.ckbDoan);
            this.groupBox1.Location = new System.Drawing.Point(11, 143);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(314, 60);
            this.groupBox1.TabIndex = 24;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Đoàn thể";
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Location = new System.Drawing.Point(73, 18);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(43, 13);
            this.label21.TabIndex = 46;
            this.label21.Text = "Chi bộ :";
            this.label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // cbo_chibo
            // 
            this.cbo_chibo.FormattingEnabled = true;
            this.cbo_chibo.Location = new System.Drawing.Point(120, 11);
            this.cbo_chibo.Name = "cbo_chibo";
            this.cbo_chibo.Size = new System.Drawing.Size(188, 21);
            this.cbo_chibo.TabIndex = 21;
            // 
            // ckbCongDoan
            // 
            this.ckbCongDoan.Location = new System.Drawing.Point(15, 33);
            this.ckbCongDoan.Name = "ckbCongDoan";
            this.ckbCongDoan.Size = new System.Drawing.Size(80, 24);
            this.ckbCongDoan.TabIndex = 2;
            this.ckbCongDoan.Text = "Công đoàn";
            this.ckbCongDoan.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.ckbCongDoan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ckbCongDoan_KeyDown);
            // 
            // ckbDoan
            // 
            this.ckbDoan.Location = new System.Drawing.Point(104, 33);
            this.ckbDoan.Name = "ckbDoan";
            this.ckbDoan.Size = new System.Drawing.Size(69, 24);
            this.ckbDoan.TabIndex = 3;
            this.ckbDoan.Text = "Đoàn";
            this.ckbDoan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ckbDoan_KeyDown);
            // 
            // cbobGioiTinh
            // 
            this.cbobGioiTinh.Location = new System.Drawing.Point(528, 6);
            this.cbobGioiTinh.Name = "cbobGioiTinh";
            this.cbobGioiTinh.Size = new System.Drawing.Size(64, 21);
            this.cbobGioiTinh.TabIndex = 4;
            this.cbobGioiTinh.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobGioiTinh_KeyDown);
            // 
            // butXemDS
            // 
            this.butXemDS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butXemDS.Image = ((System.Drawing.Image)(resources.GetObject("butXemDS.Image")));
            this.butXemDS.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butXemDS.Location = new System.Drawing.Point(238, 3);
            this.butXemDS.Name = "butXemDS";
            this.butXemDS.Size = new System.Drawing.Size(60, 28);
            this.butXemDS.TabIndex = 0;
            this.butXemDS.Text = "    Tìm";
            this.butXemDS.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.butXemDS.Click += new System.EventHandler(this.butXemDS_Click);
            // 
            // label2
            // 
            this.label2.Location = new System.Drawing.Point(128, 10);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(33, 13);
            this.label2.TabIndex = 6;
            this.label2.Text = "Đến:";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label3
            // 
            this.label3.Location = new System.Drawing.Point(220, 10);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(76, 13);
            this.label3.TabIndex = 20;
            this.label3.Text = "Sinh từ tháng:";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label4
            // 
            this.label4.Location = new System.Drawing.Point(341, 10);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(63, 13);
            this.label4.TabIndex = 30;
            this.label4.Text = "Đến tháng:";
            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label5
            // 
            this.label5.Location = new System.Drawing.Point(474, 10);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(53, 13);
            this.label5.TabIndex = 21;
            this.label5.Text = "Giới tính:";
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label6
            // 
            this.label6.Location = new System.Drawing.Point(622, 10);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(51, 13);
            this.label6.TabIndex = 22;
            this.label6.Text = "Dân tộc:";
            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label7
            // 
            this.label7.Location = new System.Drawing.Point(34, 104);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(55, 13);
            this.label7.TabIndex = 31;
            this.label7.Text = "Tôn giáo:";
            this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label8
            // 
            this.label8.Location = new System.Drawing.Point(10, 34);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(79, 13);
            this.label8.TabIndex = 23;
            this.label8.Text = "Thường trú tại:";
            this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label9
            // 
            this.label9.Location = new System.Drawing.Point(235, 103);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(61, 13);
            this.label9.TabIndex = 32;
            this.label9.Text = "Mã ngạch:";
            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label10
            // 
            this.label10.Location = new System.Drawing.Point(309, 34);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(95, 13);
            this.label10.TabIndex = 24;
            this.label10.Text = "Trình độ học vấn:";
            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label11
            // 
            this.label11.Location = new System.Drawing.Point(475, 102);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(52, 13);
            this.label11.TabIndex = 33;
            this.label11.Text = "Loại HĐ:";
            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label12
            // 
            this.label12.Location = new System.Drawing.Point(601, 34);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(72, 13);
            this.label12.TabIndex = 25;
            this.label12.Text = "Chuyên môn:";
            this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label13
            // 
            this.label13.Location = new System.Drawing.Point(193, 56);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(103, 13);
            this.label13.TabIndex = 26;
            this.label13.Text = "Trình độ ngoại ngữ:";
            this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label14
            // 
            this.label14.Location = new System.Drawing.Point(419, 56);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(108, 13);
            this.label14.TabIndex = 27;
            this.label14.Text = "Thâm niên công tác:";
            this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label15
            // 
            this.label15.Location = new System.Drawing.Point(19, 80);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(70, 13);
            this.label15.TabIndex = 28;
            this.label15.Text = "Hệ số lương:";
            this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label16
            // 
            this.label16.Location = new System.Drawing.Point(263, 79);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(33, 13);
            this.label16.TabIndex = 20;
            this.label16.Text = "Đến:";
            this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label17
            // 
            this.label17.Location = new System.Drawing.Point(429, 79);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(98, 13);
            this.label17.TabIndex = 29;
            this.label17.Text = "Bộ phận công tác:";
            this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txbTuoiDen
            // 
            this.txbTuoiDen.Location = new System.Drawing.Point(163, 6);
            this.txbTuoiDen.MaxLength = 2;
            this.txbTuoiDen.Name = "txbTuoiDen";
            this.txbTuoiDen.Size = new System.Drawing.Size(40, 20);
            this.txbTuoiDen.TabIndex = 1;
            this.txbTuoiDen.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txbTuoiDen_KeyPress);
            this.txbTuoiDen.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txbTuoiDen_KeyDown);
            // 
            // txbSinhTuThang
            // 
            this.txbSinhTuThang.Location = new System.Drawing.Point(297, 6);
            this.txbSinhTuThang.MaxLength = 2;
            this.txbSinhTuThang.Name = "txbSinhTuThang";
            this.txbSinhTuThang.Size = new System.Drawing.Size(36, 20);
            this.txbSinhTuThang.TabIndex = 2;
            this.txbSinhTuThang.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txbSinhTuThang_KeyPress);
            this.txbSinhTuThang.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txbSinhTuThang_KeyDown);
            // 
            // txbDenThang
            // 
            this.txbDenThang.Location = new System.Drawing.Point(408, 6);
            this.txbDenThang.MaxLength = 2;
            this.txbDenThang.Name = "txbDenThang";
            this.txbDenThang.Size = new System.Drawing.Size(40, 20);
            this.txbDenThang.TabIndex = 3;
            this.txbDenThang.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txbDenThang_KeyPress);
            this.txbDenThang.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txbDenThang_KeyDown);
            // 
            // cbobThamNienCT
            // 
            this.cbobThamNienCT.Location = new System.Drawing.Point(528, 53);
            this.cbobThamNienCT.MaxLength = 2;
            this.cbobThamNienCT.Name = "cbobThamNienCT";
            this.cbobThamNienCT.Size = new System.Drawing.Size(60, 20);
            this.cbobThamNienCT.TabIndex = 11;
            this.toolTip1.SetToolTip(this.cbobThamNienCT, "Thâm niên công tác (năm)");
            this.cbobThamNienCT.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbobThamNienCT_KeyPress);
            this.cbobThamNienCT.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobThamNienCT_KeyDown);
            // 
            // cbobHeSoLuong
            // 
            this.cbobHeSoLuong.Location = new System.Drawing.Point(90, 77);
            this.cbobHeSoLuong.MaxLength = 4;
            this.cbobHeSoLuong.Name = "cbobHeSoLuong";
            this.cbobHeSoLuong.Size = new System.Drawing.Size(100, 20);
            this.cbobHeSoLuong.TabIndex = 13;
            this.cbobHeSoLuong.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbobHeSoLuong_KeyPress);
            this.cbobHeSoLuong.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobHeSoLuong_KeyDown);
            // 
            // cbobHeSoLuongDen
            // 
            this.cbobHeSoLuongDen.Location = new System.Drawing.Point(297, 77);
            this.cbobHeSoLuongDen.MaxLength = 4;
            this.cbobHeSoLuongDen.Name = "cbobHeSoLuongDen";
            this.cbobHeSoLuongDen.Size = new System.Drawing.Size(103, 20);
            this.cbobHeSoLuongDen.TabIndex = 14;
            this.cbobHeSoLuongDen.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.cbobHeSoLuongDen_KeyPress);
            this.cbobHeSoLuongDen.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobHeSoLuongDen_KeyDown);
            // 
            // cbobDanToc
            // 
            this.cbobDanToc.Location = new System.Drawing.Point(674, 6);
            this.cbobDanToc.Name = "cbobDanToc";
            this.cbobDanToc.Size = new System.Drawing.Size(100, 21);
            this.cbobDanToc.TabIndex = 5;
            this.cbobDanToc.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobDanToc_KeyDown);
            // 
            // cbobTonGiao
            // 
            this.cbobTonGiao.Location = new System.Drawing.Point(90, 100);
            this.cbobTonGiao.Name = "cbobTonGiao";
            this.cbobTonGiao.Size = new System.Drawing.Size(100, 21);
            this.cbobTonGiao.TabIndex = 21;
            this.cbobTonGiao.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobTonGiao_KeyDown);
            // 
            // cbobThuongTruTai
            // 
            this.cbobThuongTruTai.Location = new System.Drawing.Point(91, 29);
            this.cbobThuongTruTai.Name = "cbobThuongTruTai";
            this.cbobThuongTruTai.Size = new System.Drawing.Size(184, 21);
            this.cbobThuongTruTai.TabIndex = 6;
            this.cbobThuongTruTai.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobThuongTruTai_KeyDown);
            // 
            // cbobMaNgach
            // 
            this.cbobMaNgach.Location = new System.Drawing.Point(297, 99);
            this.cbobMaNgach.Name = "cbobMaNgach";
            this.cbobMaNgach.Size = new System.Drawing.Size(103, 21);
            this.cbobMaNgach.TabIndex = 22;
            this.cbobMaNgach.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobMaNgach_KeyDown);
            // 
            // cbobTrinhDoHocVan
            // 
            this.cbobTrinhDoHocVan.Location = new System.Drawing.Point(408, 29);
            this.cbobTrinhDoHocVan.Name = "cbobTrinhDoHocVan";
            this.cbobTrinhDoHocVan.Size = new System.Drawing.Size(184, 21);
            this.cbobTrinhDoHocVan.TabIndex = 7;
            this.cbobTrinhDoHocVan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobTrinhDoHocVan_KeyDown);
            // 
            // cbobLoaiHD
            // 
            this.cbobLoaiHD.Location = new System.Drawing.Point(528, 99);
            this.cbobLoaiHD.Name = "cbobLoaiHD";
            this.cbobLoaiHD.Size = new System.Drawing.Size(102, 21);
            this.cbobLoaiHD.TabIndex = 23;
            this.cbobLoaiHD.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobLoaiHD_KeyDown);
            // 
            // cbobChuyenMon
            // 
            this.cbobChuyenMon.Location = new System.Drawing.Point(674, 29);
            this.cbobChuyenMon.Name = "cbobChuyenMon";
            this.cbobChuyenMon.Size = new System.Drawing.Size(100, 21);
            this.cbobChuyenMon.TabIndex = 8;
            this.cbobChuyenMon.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobChuyenMon_KeyDown);
            // 
            // cbobTrinhDoNgoaiNgu
            // 
            this.cbobTrinhDoNgoaiNgu.Location = new System.Drawing.Point(297, 53);
            this.cbobTrinhDoNgoaiNgu.Name = "cbobTrinhDoNgoaiNgu";
            this.cbobTrinhDoNgoaiNgu.Size = new System.Drawing.Size(103, 21);
            this.cbobTrinhDoNgoaiNgu.TabIndex = 10;
            this.cbobTrinhDoNgoaiNgu.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobTrinhDoNgoaiNgu_KeyDown);
            // 
            // cbobBoPhanCongTac
            // 
            this.cbobBoPhanCongTac.Location = new System.Drawing.Point(528, 76);
            this.cbobBoPhanCongTac.Name = "cbobBoPhanCongTac";
            this.cbobBoPhanCongTac.Size = new System.Drawing.Size(247, 21);
            this.cbobBoPhanCongTac.TabIndex = 15;
            this.cbobBoPhanCongTac.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbobBoPhanCongTac_KeyDown);
            // 
            // butTiepTuc
            // 
            this.butTiepTuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butTiepTuc.Image = global::Human.Properties.Resources.ok;
            this.butTiepTuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butTiepTuc.Location = new System.Drawing.Point(366, 3);
            this.butTiepTuc.Name = "butTiepTuc";
            this.butTiepTuc.Size = new System.Drawing.Size(75, 28);
            this.butTiepTuc.TabIndex = 2;
            this.butTiepTuc.Text = "Tiếp tục";
            this.butTiepTuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.butTiepTuc.Click += new System.EventHandler(this.butTiepTuc_Click);
            // 
            // butKetThuc
            // 
            this.butKetThuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butKetThuc.Image = global::Human.Properties.Resources.close_r;
            this.butKetThuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butKetThuc.Location = new System.Drawing.Point(509, 3);
            this.butKetThuc.Name = "butKetThuc";
            this.butKetThuc.Size = new System.Drawing.Size(75, 28);
            this.butKetThuc.TabIndex = 3;
            this.butKetThuc.Text = "Kết thúc";
            this.butKetThuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.butKetThuc.Click += new System.EventHandler(this.butKetThuc_Click);
            // 
            // butInDS
            // 
            this.butInDS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butInDS.Image = ((System.Drawing.Image)(resources.GetObject("butInDS.Image")));
            this.butInDS.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butInDS.Location = new System.Drawing.Point(302, 3);
            this.butInDS.Name = "butInDS";
            this.butInDS.Size = new System.Drawing.Size(60, 28);
            this.butInDS.TabIndex = 1;
            this.butInDS.Text = "In";
            this.butInDS.Click += new System.EventHandler(this.butInDS_Click);
            // 
            // checklietsi
            // 
            this.checklietsi.ForeColor = System.Drawing.Color.Navy;
            this.checklietsi.Location = new System.Drawing.Point(13, 19);
            this.checklietsi.Name = "checklietsi";
            this.checklietsi.Size = new System.Drawing.Size(95, 24);
            this.checklietsi.TabIndex = 16;
            this.checklietsi.Text = "Gia đình liệt sĩ";
            this.checklietsi.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checklietsi.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checklietsi_KeyDown);
            // 
            // checktnxp
            // 
            this.checktnxp.ForeColor = System.Drawing.Color.Navy;
            this.checktnxp.Location = new System.Drawing.Point(114, 19);
            this.checktnxp.Name = "checktnxp";
            this.checktnxp.Size = new System.Drawing.Size(86, 24);
            this.checktnxp.TabIndex = 17;
            this.checktnxp.Text = "Thương binh";
            this.checktnxp.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checktnxp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checktnxp_KeyDown);
            // 
            // checkbdxn
            // 
            this.checkbdxn.ForeColor = System.Drawing.Color.Navy;
            this.checkbdxn.Location = new System.Drawing.Point(206, 19);
            this.checkbdxn.Name = "checkbdxn";
            this.checkbdxn.Size = new System.Drawing.Size(105, 24);
            this.checkbdxn.TabIndex = 18;
            this.checkbdxn.Text = "Bộ đội xuất ngũ";
            this.checkbdxn.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checkbdxn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checkbdxn_KeyDown);
            // 
            // cbotrinhdo
            // 
            this.cbotrinhdo.Location = new System.Drawing.Point(90, 53);
            this.cbotrinhdo.Name = "cbotrinhdo";
            this.cbotrinhdo.Size = new System.Drawing.Size(100, 21);
            this.cbotrinhdo.TabIndex = 9;
            this.cbotrinhdo.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbotrinhdo_KeyDown);
            // 
            // label18
            // 
            this.label18.Location = new System.Drawing.Point(36, 56);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(53, 13);
            this.label18.TabIndex = 35;
            this.label18.Text = "Trình độ:";
            this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // cbochucdanh
            // 
            this.cbochucdanh.Location = new System.Drawing.Point(674, 53);
            this.cbochucdanh.Name = "cbochucdanh";
            this.cbochucdanh.Size = new System.Drawing.Size(100, 21);
            this.cbochucdanh.TabIndex = 12;
            this.cbochucdanh.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cbochucdanh_KeyDown);
            // 
            // label19
            // 
            this.label19.AutoSize = true;
            this.label19.Location = new System.Drawing.Point(611, 56);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(62, 13);
            this.label19.TabIndex = 37;
            this.label19.Text = "Chức danh:";
            // 
            // checknghiviec
            // 
            this.checknghiviec.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checknghiviec.Location = new System.Drawing.Point(8, 34);
            this.checknghiviec.Name = "checknghiviec";
            this.checknghiviec.Size = new System.Drawing.Size(96, 24);
            this.checknghiviec.TabIndex = 19;
            this.checknghiviec.Text = "Đã nghỉ việc";
            this.checknghiviec.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checknghiviec.CheckStateChanged += new System.EventHandler(this.checknghiviec_CheckStateChanged);
            this.checknghiviec.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checknghiviec_KeyDown);
            // 
            // checklamviec
            // 
            this.checklamviec.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checklamviec.Location = new System.Drawing.Point(8, 10);
            this.checklamviec.Name = "checklamviec";
            this.checklamviec.Size = new System.Drawing.Size(96, 24);
            this.checklamviec.TabIndex = 20;
            this.checklamviec.Text = "Đang làm việc";
            this.checklamviec.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checklamviec.CheckStateChanged += new System.EventHandler(this.checklamviec_CheckStateChanged);
            this.checklamviec.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checklamviec_KeyDown);
            // 
            // checkrutgon
            // 
            this.checkrutgon.AutoSize = true;
            this.checkrutgon.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checkrutgon.Checked = true;
            this.checkrutgon.CheckState = System.Windows.Forms.CheckState.Checked;
            this.checkrutgon.Location = new System.Drawing.Point(23, 14);
            this.checkrutgon.Name = "checkrutgon";
            this.checkrutgon.Size = new System.Drawing.Size(125, 17);
            this.checkrutgon.TabIndex = 25;
            this.checkrutgon.Text = "Mẫu báo cáo rút gọn";
            this.checkrutgon.CheckStateChanged += new System.EventHandler(this.checkrutgon_CheckStateChanged);
            this.checkrutgon.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checkrutgon_KeyDown);
            // 
            // checkchitiet
            // 
            this.checkchitiet.AutoSize = true;
            this.checkchitiet.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.checkchitiet.Location = new System.Drawing.Point(205, 14);
            this.checkchitiet.Name = "checkchitiet";
            this.checkchitiet.Size = new System.Drawing.Size(123, 17);
            this.checkchitiet.TabIndex = 26;
            this.checkchitiet.Text = "Mẫu báo cáo chi tiết";
            this.checkchitiet.CheckStateChanged += new System.EventHandler(this.checkchitiet_CheckStateChanged);
            this.checkchitiet.KeyDown += new System.Windows.Forms.KeyEventHandler(this.checkchitiet_KeyDown);
            // 
            // dataGrid1
            // 
            this.dataGrid1.AlternatingBackColor = System.Drawing.Color.Lavender;
            this.dataGrid1.BackColor = System.Drawing.Color.WhiteSmoke;
            this.dataGrid1.BackgroundColor = System.Drawing.SystemColors.Control;
            this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.dataGrid1.CaptionBackColor = System.Drawing.Color.LightSteelBlue;
            this.dataGrid1.CaptionForeColor = System.Drawing.Color.MidnightBlue;
            this.dataGrid1.CaptionVisible = false;
            this.dataGrid1.DataMember = "";
            this.dataGrid1.FlatMode = true;
            this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
            this.dataGrid1.ForeColor = System.Drawing.Color.MidnightBlue;
            this.dataGrid1.GridLineColor = System.Drawing.Color.Gainsboro;
            this.dataGrid1.GridLineStyle = System.Windows.Forms.DataGridLineStyle.None;
            this.dataGrid1.HeaderBackColor = System.Drawing.Color.MidnightBlue;
            this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
            this.dataGrid1.HeaderForeColor = System.Drawing.Color.WhiteSmoke;
            this.dataGrid1.LinkColor = System.Drawing.Color.Teal;
            this.dataGrid1.Location = new System.Drawing.Point(12, 212);
            this.dataGrid1.Name = "dataGrid1";
            this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Gainsboro;
            this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.MidnightBlue;
            this.dataGrid1.RowHeaderWidth = 10;
            this.dataGrid1.SelectionBackColor = System.Drawing.Color.CadetBlue;
            this.dataGrid1.SelectionForeColor = System.Drawing.Color.WhiteSmoke;
            this.dataGrid1.Size = new System.Drawing.Size(773, 285);
            this.dataGrid1.TabIndex = 38;
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.checklietsi);
            this.groupBox3.Controls.Add(this.checktnxp);
            this.groupBox3.Controls.Add(this.checkbdxn);
            this.groupBox3.Location = new System.Drawing.Point(463, 147);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(312, 56);
            this.groupBox3.TabIndex = 39;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "Gia cảnh";
            // 
            // groupBox4
            // 
            this.groupBox4.Controls.Add(this.checkrutgon);
            this.groupBox4.Controls.Add(this.checkchitiet);
            this.groupBox4.Location = new System.Drawing.Point(211, 503);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new System.Drawing.Size(360, 37);
            this.groupBox4.TabIndex = 40;
            this.groupBox4.TabStop = false;
            // 
            // groupBox5
            // 
            this.groupBox5.Controls.Add(this.checklamviec);
            this.groupBox5.Controls.Add(this.checknghiviec);
            this.groupBox5.Location = new System.Drawing.Point(331, 143);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new System.Drawing.Size(117, 60);
            this.groupBox5.TabIndex = 41;
            this.groupBox5.TabStop = false;
            // 
            // label20
            // 
            this.label20.Location = new System.Drawing.Point(632, 103);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(41, 13);
            this.label20.TabIndex = 43;
            this.label20.Text = "Vi tính:";
            this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // cboVitinh
            // 
            this.cboVitinh.Location = new System.Drawing.Point(674, 99);
            this.cboVitinh.Name = "cboVitinh";
            this.cboVitinh.Size = new System.Drawing.Size(100, 21);
            this.cboVitinh.TabIndex = 42;
            // 
            // lblTong
            // 
            this.lblTong.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTong.ForeColor = System.Drawing.Color.Red;
            this.lblTong.Location = new System.Drawing.Point(11, 6);
            this.lblTong.Name = "lblTong";
            this.lblTong.Size = new System.Drawing.Size(164, 20);
            this.lblTong.TabIndex = 44;
            this.lblTong.Text = "Tổng :";
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.btnexel);
            this.panel1.Controls.Add(this.butXemDS);
            this.panel1.Controls.Add(this.lblTong);
            this.panel1.Controls.Add(this.butTiepTuc);
            this.panel1.Controls.Add(this.butInDS);
            this.panel1.Controls.Add(this.butKetThuc);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel1.Location = new System.Drawing.Point(0, 542);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(792, 31);
            this.panel1.TabIndex = 45;
            // 
            // btnexel
            // 
            this.btnexel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnexel.Image = global::Human.Properties.Resources.white_excel;
            this.btnexel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnexel.Location = new System.Drawing.Point(445, 3);
            this.btnexel.Name = "btnexel";
            this.btnexel.Size = new System.Drawing.Size(60, 28);
            this.btnexel.TabIndex = 45;
            this.btnexel.Text = "Exel";
            this.btnexel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnexel.UseVisualStyleBackColor = true;
            this.btnexel.Click += new System.EventHandler(this.btnexel_Click);
            // 
            // cbo_loaingach
            // 
            this.cbo_loaingach.FormattingEnabled = true;
            this.cbo_loaingach.Location = new System.Drawing.Point(90, 123);
            this.cbo_loaingach.Name = "cbo_loaingach";
            this.cbo_loaingach.Size = new System.Drawing.Size(100, 21);
            this.cbo_loaingach.TabIndex = 46;
            // 
            // label22
            // 
            this.label22.Location = new System.Drawing.Point(9, 124);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(80, 16);
            this.label22.TabIndex = 31;
            this.label22.Text = "Loại ngạch:";
            this.label22.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label23
            // 
            this.label23.Location = new System.Drawing.Point(216, 124);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(80, 16);
            this.label23.TabIndex = 31;
            this.label23.Text = "Nhóm ngạch:";
            this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // cbo_nhomngach
            // 
            this.cbo_nhomngach.FormattingEnabled = true;
            this.cbo_nhomngach.Location = new System.Drawing.Point(297, 123);
            this.cbo_nhomngach.Name = "cbo_nhomngach";
            this.cbo_nhomngach.Size = new System.Drawing.Size(103, 21);
            this.cbo_nhomngach.TabIndex = 46;
            // 
            // frmDanhSachNV
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(792, 573);
            this.Controls.Add(this.cbo_nhomngach);
            this.Controls.Add(this.cbo_loaingach);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.label20);
            this.Controls.Add(this.cboVitinh);
            this.Controls.Add(this.groupBox5);
            this.Controls.Add(this.groupBox4);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.dataGrid1);
            this.Controls.Add(this.cbochucdanh);
            this.Controls.Add(this.label19);
            this.Controls.Add(this.label18);
            this.Controls.Add(this.label17);
            this.Controls.Add(this.label16);
            this.Controls.Add(this.label15);
            this.Controls.Add(this.label14);
            this.Controls.Add(this.label13);
            this.Controls.Add(this.label12);
            this.Controls.Add(this.label11);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.label9);
            this.Controls.Add(this.label8);
            this.Controls.Add(this.label23);
            this.Controls.Add(this.label22);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.cbotrinhdo);
            this.Controls.Add(this.cbobBoPhanCongTac);
            this.Controls.Add(this.cbobTrinhDoNgoaiNgu);
            this.Controls.Add(this.cbobChuyenMon);
            this.Controls.Add(this.cbobLoaiHD);
            this.Controls.Add(this.cbobTrinhDoHocVan);
            this.Controls.Add(this.cbobMaNgach);
            this.Controls.Add(this.cbobThuongTruTai);
            this.Controls.Add(this.cbobTonGiao);
            this.Controls.Add(this.cbobDanToc);
            this.Controls.Add(this.cbobHeSoLuongDen);
            this.Controls.Add(this.cbobHeSoLuong);
            this.Controls.Add(this.cbobThamNienCT);
            this.Controls.Add(this.txbDenThang);
            this.Controls.Add(this.txbSinhTuThang);
            this.Controls.Add(this.txbTuoiDen);
            this.Controls.Add(this.cbobGioiTinh);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.txbTuoiTu);
            this.ForeColor = System.Drawing.Color.DarkBlue;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Name = "frmDanhSachNV";
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Danh sách nhân viên";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.frmDanhSachNV_MouseMove);
            this.Load += new System.EventHandler(this.frmDanhSachNV_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
            this.groupBox3.ResumeLayout(false);
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            this.groupBox5.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion

		private void butKetThuc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void butXemDS_Click(object sender, System.EventArgs e)
		{
			if(!kiemtra()) return;
			print();
            dataGrid1.DataSource = ds.Tables[0];
		}

		private void txbTuoiTu_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
		}

		private void txbTuoiDen_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txbSinhTuThang_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void txbDenThang_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void cbobGioiTinh_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobDanToc_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobTonGiao_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobThuongTruTai_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobMaNgach_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobTrinhDoHocVan_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobLoaiHD_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobChuyenMon_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobTrinhDoNgoaiNgu_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void cbobThamNienCT_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void cbobHeSoLuong_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void cbobHeSoLuongDen_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void cbobBoPhanCongTac_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}{F4}");	
		}

		private void ckbDang_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void ckbChiBo_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void ckbCongDoan_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}

		private void ckbDoan_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");	
		}
		private void Load_GT()
		{
			cbobGioiTinh.DisplayMember="ten";
			cbobGioiTinh.ValueMember="ten";
			cbobGioiTinh.DataSource=mDB.get_data("SELECT * FROM "+m_user+".dmphai").Tables[0];
            cbobGioiTinh.SelectedIndex = -1;
		}
		private void Load_DT()
		{
			cbobDanToc.DisplayMember="tendt";
			cbobDanToc.ValueMember="madt";
            cbobDanToc.DataSource = mDB.get_dantoc().Tables[0];
            cbobDanToc.SelectedIndex = -1;
		}
		private void Load_Chucdanh()
		{
			cbochucdanh.DisplayMember ="ten";
			cbochucdanh.ValueMember ="ma";
            cbochucdanh.DataSource = mDB.get_chucdanh().Tables[0];
            cbochucdanh.SelectedIndex = -1;
		}
		private void Load_Trinhdo()
		{
			cbotrinhdo.DisplayMember ="tenbang";
			cbotrinhdo.ValueMember ="mabangcap";
            cbotrinhdo.DataSource = mDB.get_bangcap().Tables[0];
            cbotrinhdo.SelectedIndex = -1;
		}
        //moi them
        private void load_dmchibo()
        {
            cbo_chibo.DisplayMember = "ten";
            cbo_chibo.ValueMember = "ma";
            cbo_chibo.DataSource = mDB.get_dmchibo().Tables[0];
            cbo_chibo.SelectedIndex = -1;
        }

        //
		private void Load_TG()
		{
			cbobTonGiao.DisplayMember="tentg";
			cbobTonGiao.ValueMember="matgiao";
            cbobTonGiao.DataSource = mDB.get_tongiao().Tables[0];
            cbobTonGiao.SelectedIndex = -1;
		}
		private void Load_TTT()
		{
			cbobThuongTruTai.DisplayMember="tentt";
			cbobThuongTruTai.ValueMember="matt";
            cbobThuongTruTai.DataSource = mDB.get_data("SELECT * FROM " + m_user + ".btdtt").Tables[0];
            cbobThuongTruTai.SelectedIndex = -1;
		}
		private void Load_MN()
		{
			cbobMaNgach.DisplayMember="diengiai";
			cbobMaNgach.ValueMember="ma";
            cbobMaNgach.DataSource = mDB.get_mangach().Tables[0];
            cbobMaNgach.SelectedIndex = -1;
		}
		private void Load_TDHV()
		{
			cbobTrinhDoHocVan.DisplayMember="tenhv";
			cbobTrinhDoHocVan.ValueMember="mahv";
            cbobTrinhDoHocVan.DataSource = mDB.get_hocvan().Tables[0];
            cbobTrinhDoHocVan.SelectedIndex = -1;
		}
		private void Load_HD()
		{
			cbobLoaiHD.DisplayMember="tenhd";
			cbobLoaiHD.ValueMember="mahd";
            cbobLoaiHD.DataSource = mDB.get_data("SELECT * FROM " + m_user + ".mahd order by mahd").Tables[0];
            cbobLoaiHD.SelectedIndex = -1;
		}
		private void Load_CM()
		{
			cbobChuyenMon.DisplayMember="tenctdt";
			cbobChuyenMon.ValueMember="mactdt";
            cbobChuyenMon.DataSource = mDB.get_ctdaotao().Tables[0];
            cbobChuyenMon.SelectedIndex = -1;
		}
		private void Load_TDNN()
		{
			cbobTrinhDoNgoaiNgu.DisplayMember="tennn";
			cbobTrinhDoNgoaiNgu.ValueMember="mann";
            cbobTrinhDoNgoaiNgu.DataSource = mDB.get_ngoaingu().Tables[0];
            cbobTrinhDoNgoaiNgu.SelectedIndex = -1;
		}
		private void Load_BPCT()
		{
			cbobBoPhanCongTac.DisplayMember="tenbp";
			cbobBoPhanCongTac.ValueMember="madv";
            cbobBoPhanCongTac.DataSource = mDB.get_bophan().Tables[0];
            cbobBoPhanCongTac.SelectedIndex = -1;
		}
        private void load_loaingach()
        {
            cbo_loaingach.DisplayMember = "loaingach";
            cbo_loaingach.ValueMember = "loaingach";
            cbo_loaingach.DataSource = mDB.get_loaingach().Tables[0];
            cbo_loaingach.SelectedIndex = -1;
        }
        private void load_nhomngach()
        {
            cbo_nhomngach.DisplayMember = "tennhom";
            cbo_nhomngach.ValueMember = "manhom";
            cbo_nhomngach.DataSource = mDB.get_nhomngach().Tables[0];
            cbo_nhomngach.SelectedIndex = -1;
        }
		private void frmDanhSachNV_Load(object sender, System.EventArgs e)
		{
            m_user = mDB.user;
            txbTuoiTu.Focus();
			Load_GT();Load_DT();Load_TG();Load_TTT();
			Load_MN();Load_TDHV();Load_HD();
            Load_CM(); Load_TDNN(); Load_BPCT(); load_loaingach();
            Load_Chucdanh(); Load_Trinhdo(); load_dmchibo(); load_nhomngach();
			cbobHeSoLuong.Text="";
			cbobHeSoLuongDen.Text="";
			//
			cboVitinh.DisplayMember="ten";
			cboVitinh.ValueMember="ma";
            cboVitinh.DataSource = mDB.get_data("select * from " + m_user + ".tdnnth where tinhoc=true").Tables[0];
		}
		private void AddTableStype()
		{
			
			dataGrid1.TableStyles.Clear();
			DataGridTableStyle ts = new DataGridTableStyle();
			ts.MappingName = ds.Tables[0].TableName;
					
			ts.AlternatingBackColor = Color.Beige;
			ts.BackColor = Color.GhostWhite;
			ts.ForeColor = Color.MidnightBlue;
			ts.GridLineColor = Color.RoyalBlue;
			ts.HeaderBackColor = Color.MidnightBlue;
			ts.HeaderForeColor = Color.Lavender;
			ts.SelectionBackColor = Color.Teal;
			ts.SelectionForeColor = Color.PaleGreen;
				
			DataGridTextBoxColumn TextCol1=new DataGridTextBoxColumn();
			TextCol1.MappingName = "manv";
			TextCol1.HeaderText = "Mã nhân viên";
			TextCol1.Width = 80;
			TextCol1.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol1);
			dataGrid1.TableStyles.Add(ts);
			
			DataGridTextBoxColumn TextCol2=new DataGridTextBoxColumn();
			TextCol2.MappingName = "hoten";
			TextCol2.HeaderText = "Họ và tên";
			TextCol2.Width = 120;
			TextCol2.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol2);
			dataGrid1.TableStyles.Add(ts);

			DataGridTextBoxColumn TextCol22=new DataGridTextBoxColumn();
			TextCol22.MappingName = "ngaysinh";
			TextCol22.HeaderText = "Ngày sinh";
			TextCol22.Width = 80;
			TextCol22.Format="dd/MM/yyyy";
			TextCol22.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol22);
			dataGrid1.TableStyles.Add(ts);
			
			DataGridTextBoxColumn TextCol5=new DataGridTextBoxColumn();
			TextCol5.MappingName = "phai";
			TextCol5.HeaderText = "Phái";
			TextCol5.Width = 50;
			TextCol5.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol5);
			dataGrid1.TableStyles.Add(ts);

			DataGridTextBoxColumn TextCol3=new DataGridTextBoxColumn();
			TextCol3.MappingName = "bophan";
			TextCol3.HeaderText = "Khoa/Phòng";
			TextCol3.Width = 100;
			TextCol3.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol3);
			dataGrid1.TableStyles.Add(ts);
			
			DataGridTextBoxColumn TextCol4=new DataGridTextBoxColumn();
			TextCol4.MappingName = "mangach";
			TextCol4.HeaderText = "Mã ngạch";
			TextCol4.Width = 60;
			TextCol4.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol4);
			dataGrid1.TableStyles.Add(ts);
			
			
			DataGridTextBoxColumn TextCol7=new DataGridTextBoxColumn();
			TextCol7.MappingName = "Tenmangach";
			TextCol7.HeaderText = "Tên ngạch";
			TextCol7.Width = 150;
			TextCol7.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol7);
			dataGrid1.TableStyles.Add(ts);

			
			DataGridTextBoxColumn TextCol6=new DataGridTextBoxColumn();
			TextCol6.MappingName = "tenhd";
			TextCol6.HeaderText = "Loại hợp đồng";
			TextCol6.Width = 120;
			TextCol6.Alignment=HorizontalAlignment.Left;
			ts.GridColumnStyles.Add(TextCol6);
			dataGrid1.TableStyles.Add(ts);
			
			
			
			ts.DataGrid.DataSource=ds.Tables[0]; 		
			CurrencyManager cm = (CurrencyManager) BindingContext[dataGrid1.DataSource,dataGrid1.DataMember];
			DataView dv = (DataView) cm.List;
			dv.AllowNew=false;
			dv.AllowEdit=false;
		}

		private void frmDanhSachNV_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (bClear)
			{
				cbobGioiTinh.SelectedIndex=-1;
				cbobDanToc.SelectedIndex=-1;
				cbobTonGiao.SelectedIndex=-1;
				cbobThuongTruTai.SelectedIndex=-1;
				cbobMaNgach.SelectedIndex=-1;
				cbobTrinhDoHocVan.SelectedIndex=-1;
				cbobLoaiHD.SelectedIndex=-1;
				cbobChuyenMon.SelectedIndex=-1;
				cbobTrinhDoNgoaiNgu.SelectedIndex=-1;
				cbobBoPhanCongTac.SelectedIndex=-1;
				cbotrinhdo.SelectedIndex =-1;
				cbochucdanh.SelectedIndex =-1;
				bClear=false;
			}
		}
		private string dieukien()
		{
			string loc="";

            int i1 = 0;// int.Parse(dotuoi.Substring(0, dotuoi.IndexOf("-")));
            int i2 = 0;// int.Parse(dotuoi.Substring(dotuoi.IndexOf("-") + 1));
            //sql += " and to_number(to_char(now(),'yyyy'),'0000')-to_number(a.namsinh,'0000') between " + i1 + " and " + i2;

			if(txbTuoiTu.Text.Trim()!="" && txbTuoiDen.Text.Trim()=="") 
			{
                i1 = int.Parse(txbTuoiTu.Text);
                loc = " and to_number(to_char(now(),'yyyy'),'0000')-to_number(l.namsinh,'0000') >= " + i1 ;
			}
			else 
				if(txbTuoiDen.Text.Trim()!="" && txbTuoiTu.Text.Trim()=="") 
			{
                i1 = int.Parse(txbTuoiDen.Text);
                loc = " and to_number(to_char(now(),'yyyy'),'0000')-to_number(l.namsinh,'0000') <= " + i1; 
			}
			else
				if(txbTuoiDen.Text.Trim()!="" && txbTuoiTu.Text.Trim()!="") 
			    {
                    i1 = int.Parse(txbTuoiTu.Text);
                    i2 = int.Parse(txbTuoiDen.Text);
                    loc = " and to_number(to_char(now(),'yyyy'),'0000')-to_number(l.namsinh,'0000') between " + i1 + " and " + i2;
			    }
			if(txbSinhTuThang.Text.Trim()!="" && txbDenThang.Text.Trim()=="") 
			{
                i1 = int.Parse(txbSinhTuThang.Text);
                loc = " and to_number(to_char(l.ngaysinh,'mm'),'00') >=" + i1 + "";
			}
			else			
				if(txbDenThang.Text.Trim()!="" && txbSinhTuThang.Text.Trim()=="") 
			{
                i1 = int.Parse(txbDenThang.Text);
                loc= " and to_number(to_char(l.ngaysinh,'mm'),'00')<=" + i1 + "";
			}
			else
				if(txbDenThang.Text.Trim()!="" && txbSinhTuThang.Text.Trim()!="") 
			{
                i1 = int.Parse(txbSinhTuThang.Text);
                i2 = int.Parse(txbDenThang.Text);
                loc = " and to_number(to_char(l.ngaysinh,'mm'),'00') between " + i1 + " and " + i2;
			}
			if(cbobGioiTinh.SelectedIndex!=-1)
				loc+=" and l.phai='"+cbobGioiTinh.SelectedValue.ToString()+"'";
			if(cbobDanToc.SelectedIndex!=-1) 
				loc+=" and l.madt='"+cbobDanToc.SelectedValue.ToString()+"'";
			if(cbobTonGiao.SelectedIndex!=-1) 
				loc+=" and l.matgiao='"+cbobTonGiao.SelectedValue.ToString()+"'";
			if(cbobThuongTruTai.SelectedIndex!=-1) 
				loc+=" and l.t_diachi='"+cbobThuongTruTai.SelectedValue.ToString()+"'";
			if(cbobMaNgach.SelectedIndex!=-1)
				loc+=" and h.mangach='"+cbobMaNgach.SelectedValue.ToString()+"'";
			if(cbobTrinhDoHocVan.SelectedIndex!=-1) 
				loc+=" and l.mahv='"+cbobTrinhDoHocVan.SelectedValue.ToString()+"'";
			if(cbobLoaiHD.SelectedIndex!=-1) 
				loc+=" and h.loaihd='"+cbobLoaiHD.SelectedValue.ToString()+"'";
			if(cbobChuyenMon.SelectedIndex!=-1) 
				loc+=" and l.nnghiep='"+cbobChuyenMon.SelectedValue.ToString()+"'";
			if(cbobTrinhDoNgoaiNgu.SelectedIndex!=-1)
                loc += " and (l.mann='" + cbobTrinhDoNgoaiNgu.SelectedValue.ToString() + "' or l.mann1='" + cbobTrinhDoNgoaiNgu.SelectedValue.ToString() + "' or l.mann2='" + cbobTrinhDoNgoaiNgu.SelectedValue.ToString() + "' or l.mann3='" + cbobTrinhDoNgoaiNgu.SelectedValue.ToString() + "')";
            if (cbobThamNienCT.Text.Trim() != "")
            {
                loc += " and now()- h.ngaydenct >="+songay(int.Parse(cbobThamNienCT.Text));
            }
			if(cbobBoPhanCongTac.SelectedIndex!=-1)
				loc+=" and l.madv='"+cbobBoPhanCongTac.SelectedValue.ToString()+"'";
			if(ckbDang.Checked==true)
				loc+=" and (h.dang='R' or h.dang='r')";
            //if(ckbChiBo.Checked==true) 
            //    loc+=" and (trim(h.chi_bo)<>'')";
            if (cbo_chibo.SelectedIndex != -1)
                loc += " and h.chi_bo='"+cbo_chibo.SelectedValue.ToString()+"'";
			if(ckbCongDoan.Checked==true)
				loc+=" and (h.cong_doan='R' or h.cong_doan='r')";				
			if(ckbDoan.Checked==true)
				loc+=" and (h.doan='R' or h.doan='r')";		
			if(cbobHeSoLuong.Text!="" && cbobHeSoLuongDen.Text!="")
				loc+=" and (h.HS_LC)>="+cbobHeSoLuong.Text+" and (h.HS_LC)<="+cbobHeSoLuongDen.Text+"";
			else
				if(cbobHeSoLuongDen.Text!="")
				loc+=" and (h.HS_LC)="+cbobHeSoLuongDen.Text;
			else
				if(cbobHeSoLuong.Text!="")
				loc+=" and (h.HS_LC)="+cbobHeSoLuong.Text;	
		
			if(checkbdxn.Checked ==true)
				loc+=" and thuongbinh=1";
			if(checklietsi.Checked ==true)
				loc+=" and lietsi=1";
			if(checktnxp.Checked ==true)
				loc+=" and tnxp=1";
			if(cbochucdanh.SelectedIndex !=-1)
				loc+=" and l.macd='"+cbochucdanh.SelectedValue.ToString().Trim()+"'";
			if(cbotrinhdo.SelectedIndex !=-1)
				loc+=" and l.td_nnghiep='"+cbotrinhdo.SelectedValue.ToString().Trim()+"'";
			if(checknghiviec.Checked ==true)
				loc+=" and h.ngaynghi is not null";
			else
				loc+=" and h.ngaynghi is null";
			if (cboVitinh.SelectedIndex>0)
				loc+=" and l.tdth='"+cboVitinh.SelectedValue.ToString()+"'";
            if (cbo_loaingach.SelectedIndex != -1)
                loc += " and mg.loaingach='"+cbo_loaingach.SelectedValue.ToString().Trim()+"'";
            if (cbo_nhomngach.SelectedIndex != -1)
                loc += " and mg.nhomngach='" + cbo_nhomngach.SelectedValue.ToString().Trim() + "'";

			return loc;
		}
		private void print()
		{
			string sql ="";					  
            sql = " SELECT trim(l.ho)||' '||trim(l.ten) AS Hoten,";
            sql += " extract(day from now()-h.ngaybhxh) as tongsongay,";
            sql += " CASE WHEN to_char(ngaysinh,'dd/mm/yyyy')<>'' THEN  to_char(ngaysinh,'dd/mm/yyyy')  ELSE namsinh END  AS Ngaysinh ,";
            sql += " l.stt AS STT, mh.tenhd , to_char(h.NGAYBHXH,'dd/mm/yyyy') AS NgayBHXH, mg.diengiai as tenmangach, 0 AS Nam, 0 AS Thang, ";
            sql += " b.tenbp AS BoPhan, to_char(now(),'dd') AS Ngay, to_char(now(),'mm') AS Thang_ht, to_char(now(),'yyyy') AS Nam_ht, ";
            sql += " l.manv,l.madv, h.MANGACH AS mangach,  l.phai, l.madt,d.tendt, l.matgiao,t.tentg, l.t_diachi, l.mahv,hv.tenhv, mh.tenhd as loaihd, l.nnghiep, ";
            sql += " l.mann,n.tennn,tdnnth.ten as td1, Min(h.HS_LC) AS min_L, Max(h.HS_LC) AS max_L,h.bac, nn1.tennn as nn1, ";
            sql += " td2.ten as td2,nn2.tennn as nn2,td3.ten as td2, nn3.tennn as nn3,td3.ten as td3,to_char(l.dubi_dang,'dd/MM/yyyy') as dubidang,to_char(l.cthuc_dang,'dd/MM/yyyy') as chinhthucdang, ";
            sql += " l.madv, h.DANG, h.CHI_BO, h.CONG_DOAN, h.doan,to_char(h.ngaybnngach,'dd/mm/yyyy') as ngaybonhiem,h.hs_lc";
            sql += " ,tgbn,cd.ten,trim(ct.tenctdt)||' - '||trim(bc.tenbang) as tenbang,tdqlnn.ten as qlnn,cv.diengiai,ct.tenctdt ";
            sql += " ,case when l.chinhtri='CC' then 'Cao cấp' when l.chinhtri='CN' then 'Cử nhân' when l.chinhtri='TC' then 'Trung cấp' ";
            sql += " when l.chinhtri='SC' then 'Sơ cấp' when l.chinhtri = 'PT' then 'Phổ thông' else null end chinhtri";
            sql += " ,b.sothutu as stt_bp,cv.stt as stt_cv,cd.thutu as stt_cd";
            sql += " from " + m_user + ".llnv l inner join " + m_user + ".hopdong h on l.manv=h.manv";
            sql += " left join " + m_user + ".mahd  mh on mh.mahd=h.loaihd";
            sql += " left join " + m_user + ".mangach mg on mg.ma=h.mangach";
            sql += " left join " + m_user + ".bophan b on b.madv=l.madv";
            sql += " left join " + m_user + ".dantoc d on d.madt=l.madt";
            sql += " left join " + m_user + ".tongiao t on t.matgiao=l.matgiao";
            sql += " left join " + m_user + ".btdtt bt on bt.matt=l.t_diachi";
            sql += " left join " + m_user + ".hocvan hv on hv.mahv=l.mahv";
            sql += " left join " + m_user + ".ctdaotao ct on ct.mactdt=l.nnghiep";
            sql += " left join " + m_user + ".ngoaingu n on n.mann=l.mann";
            sql += " left join " + m_user + ".tdnnth   on tdnnth.ma=l.tdnn";
            sql += " left join " + m_user + ".dmcv cv on h.macv=cv.macv";
            sql += " left join " + m_user + ".dmcd cd on l.macd=cd.ma";
            sql += " left join " + m_user + ".bangcap bc on bc.mabangcap=l.td_nnghiep";
            sql += " left join " + m_user + ".ngoaingu_1 nn1 on nn1.mann=l.mann1";
            sql += " left join " + m_user + ".ngoaingu_2 nn2 on nn2.mann=l.mann2";
            sql += " left join " + m_user + ".ngoaingu_3 nn3 on nn3.mann=l.mann3";
            sql += " left join " + m_user + ".tdnn1 td1 on td1.ma=l.tdnn1 ";
            sql += " left join " + m_user + ".tdnn2 td2 on td2.ma=l.tdnn2 ";
            sql += " left join " + m_user + ".tdnn3 td3 on td3.ma=l.tdnn3";
            sql += " left join " + m_user + ".tdqlnn  on tdqlnn.ma=h.tdqlnn";
            sql += " left join " + m_user + ".loaingach ln on mg.loaingach=ln.loaingach";
            sql += " left join " + m_user + ".nhomngach nhn on mg.nhomngach=nhn.manhom";
            sql += " inner join "+m_user+".max_lan ml on h.manv=ml.manv";
            sql += " where   l.manv=h.manv ";//and h.ngaynghi is null ";
            sql += " and h.lan=ml.lan";
            sql += dieukien(); 
            sql += " group by trim(l.ho)||' '||trim(l.ten),CASE WHEN to_char(ngaysinh,'dd/mm/yyyy')<>'' THEN  to_char(ngaysinh,'dd/mm/yyyy')  ELSE namsinh END ,";
            sql += " l.stt, mh.tenhd,n.tennn,tdnnth.ten,nn1.tennn,td2.ten,td2.ten,td3.ten,nn2.tennn,nn3.tennn,d.tendt,t.tentg,hv.tenhv,l.dubi_dang,l.cthuc_dang,";
            sql += " h.ngaybhxh, mg.diengiai , b.tenbp, to_char(now(),'dd'), to_char(now(),'mm') , to_char(now(),'yyyy'),";
            sql += " h.loaihd, l.madv, h.MANGACH, l.phai, l.madt, l.matgiao,h.bac, l.t_diachi, h.MANGACH, l.mahv, h.LOAIHD, l.nnghiep, l.mann, l.madv, h.DANG, h.CHI_BO, h.CONG_DOAN, h.DOAN,h.hs_lc,tdqlnn.ten,";
            sql += " to_char(h.ngaybnngach,'dd/mm/yyyy') ,tgbn,cd.ten,bc.tenbang,l.chinhtri,cv.diengiai,ct.tenctdt,b.sothutu,cv.stt,cd.thutu,l.manv ";
            sql += " order by b.sothutu,cv.stt,cd.thutu,l.manv";
            ds=mDB.get_data(sql);
			lblTong.Text="Tổng: "+ds.Tables[0].Rows.Count.ToString();
			AddTableStype();	
		}
        private DataSet exp_exel(DataSet dse)
        {
            string[] str = new string[] {lan.Change_language_MessageText( "STT"),lan.Change_language_MessageText( "Họ Và Tên"), lan.Change_language_MessageText("Ngày Sinh"),lan.Change_language_MessageText("Khoa/Phòng"),lan.Change_language_MessageText( "Loại HD"),lan.Change_language_MessageText( "Ngày BHXH"),lan.Change_language_MessageText( "Mã Ngạch"),lan.Change_language_MessageText( "TN Năm"),lan.Change_language_MessageText( "TN Tháng") };
            DataSet dse1 = new DataSet();
            dse1.Tables.Add();
            dse1.Tables[0].Columns.Add("stt", typeof(string));
            dse1.Tables[0].Columns.Add("Hoten", typeof(string));
            /*dse1.Tables[0].Columns.Add("Ngaysinh", typeof(string));
            dse1.Tables[0].Columns.Add("BoPhan", typeof(string));
            dse1.Tables[0].Columns.Add("loaihd", typeof(string));
            dse1.Tables[0].Columns.Add("NgayBHXH", typeof(string));
            dse1.Tables[0].Columns.Add("mangach", typeof(string));
            dse1.Tables[0].Columns.Add("Nam", typeof(string));
            dse1.Tables[0].Columns.Add("Thang", typeof(string));
            */

            int stt = 0;
            DataRow nrow;
            foreach (DataRow r in dse.Tables[0].Rows)
            {
                stt++;
                nrow = dse1.Tables[0].NewRow();
                nrow["stt"] = stt;
                nrow["Hoten"] = r["Hoten"].ToString();
               /* nrow["Ngaysinh"] = r["Ngaysinh"].ToString();
                nrow["BoPhan"] = r["BoPhan"].ToString();
                nrow["loaihd"] = r["loaihd"].ToString();
                nrow["NgayBHXH"] = r["NgayBHXH"].ToString();
                nrow["mangach"] = r["mangach"].ToString();
                nrow["Nam"] = r["Nam"].ToString();
                nrow["Thang"] = r["Thang"].ToString();
                */
                dse1.Tables[0].Rows.Add(nrow);
            }
            return dse1;
        }
		private void butInDS_Click(object sender, System.EventArgs e)
		{
            print();
            if (checkchitiet.Checked == true)
            {
                ds.WriteXml("..\\xml\\h_dscongnhanvienct.xml", XmlWriteMode.WriteSchema);
                if (ds!=null)
                {
                    frmReport f = new frmReport(mDB, ds,lan.Change_language_MessageText( "DANH SÁCH CÁN BỘ CÔNG CHỨC"), "h_dscongnhanvienct.rpt", true, user_dn);
                    f.ShowDialog(this);
                }
                else
                    MessageBox.Show(("Không có dữ liệu !"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                ds.WriteXml("..\\xml\\h_danhsachNV.xml", XmlWriteMode.WriteSchema);
                if (ds!=null)
                {
                    frmReport f = new frmReport(mDB, ds,lan.Change_language_MessageText(lan.Change_language_MessageText( "DANH SÁCH CÁN BỘ CÔNG CHỨC")), "h_danhsachNV.rpt", true,user_dn);
                    f.ShowDialog(this);
                }
                else
                    MessageBox.Show(lan.Change_language_MessageText("Không có dữ liệu !"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);

            }
		}

		private void butTiepTuc_Click(object sender, System.EventArgs e)
		{
			txbTuoiTu.Text="";
			txbTuoiDen.Text="";
			txbSinhTuThang.Text="";
			txbDenThang.Text="";
			cbobGioiTinh.SelectedIndex=-1;
			cbobDanToc.SelectedIndex=-1;
			cbobTonGiao.SelectedIndex=-1;
			cbobThuongTruTai.SelectedIndex=-1;
			cbobMaNgach.SelectedIndex=-1;
			cbobTrinhDoHocVan.SelectedIndex=-1;
			cbobLoaiHD.SelectedIndex=-1;
			cbobChuyenMon.SelectedIndex=-1;
			cbobTrinhDoNgoaiNgu.SelectedIndex=-1;
			cbobThamNienCT.Text="";
			cbobHeSoLuong.Text="";
			cbobHeSoLuongDen.Text="";
			cbobBoPhanCongTac.SelectedIndex=-1;
			cbochucdanh.SelectedIndex =-1;
			cbotrinhdo.SelectedIndex =-1;
			checkchitiet.Checked =false;
			checkrutgon.Checked =false;
			checknghiviec.Checked =false;
			checklamviec.Checked =false;
			ckbDang.Checked=false;
			
			ckbCongDoan.Checked=false;
			ckbDoan.Checked=false;
            dataGrid1.DataSource = null;
		}

		private bool kiemtra()
		{			
			if(txbTuoiTu.Text!="")
			{
				if(int.Parse(txbTuoiTu.Text.ToString())>70)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập sai tuổi"),lan.Change_language_MessageText("Thông Báo"));
					txbTuoiTu.Focus();
					return false;
				}
				if(txbTuoiDen.Text!="")
				{
					if((int.Parse(txbTuoiTu.Text.ToString())) > (int.Parse(txbTuoiDen.Text.ToString())))
					{
						MessageBox.Show(lan.Change_language_MessageText("Tuổi từ <= tuổi đến"),("Thông Báo"));
						txbTuoiTu.Focus();
						return false;
					}
				}
			}
			if(txbTuoiDen.Text!="")
			{
				if(int.Parse(txbTuoiDen.Text)<0 || int.Parse(txbTuoiDen.Text)>70)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập sai tuổi"),lan.Change_language_MessageText("Thông Báo"));
					txbTuoiDen.Focus();
					return false;
				}
				if(txbTuoiTu.Text!="")
				{
					if(int.Parse(txbTuoiDen.Text)<int.Parse(txbTuoiTu.Text))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập độ tuổi từ <= độ tuổi đến"),lan.Change_language_MessageText("Thông Báo"));
						txbTuoiDen.Focus();
						return false;
					}
				}
			}
			if(txbSinhTuThang.Text!="")
			{				
				if(int.Parse(txbSinhTuThang.Text)<1 || int.Parse(txbSinhTuThang.Text)>12)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),lan.Change_language_MessageText("Thông Báo"));
					txbSinhTuThang.Focus();
					return false;
				}
				if(txbDenThang.Text!="")
				{
					if(int.Parse(txbSinhTuThang.Text)>int.Parse(txbDenThang.Text))
					{
						MessageBox.Show(lan.Change_language_MessageText("Sinh từ tháng <= đến tháng"),lan.Change_language_MessageText("Thông Báo"));
						txbSinhTuThang.Focus();
						return false;
					}
				}
			}
			if(txbDenThang.Text!="")
			{
				if((int.Parse(txbDenThang.Text) < 1) || (int.Parse(txbDenThang.Text)>12))
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập tháng không hợp lệ"),lan.Change_language_MessageText("Thông Báo"));
					txbDenThang.Focus();
					return false;
				}
				if(txbSinhTuThang.Text!="")
				{
					if(int.Parse(txbSinhTuThang.Text) > int.Parse(txbDenThang.Text))
					{
						MessageBox.Show(lan.Change_language_MessageText("Sinh từ tháng <= đến tháng"),lan.Change_language_MessageText("Thông Báo"));
						txbDenThang.Focus();
						return false;
					}
				}
			}
			if(cbobThamNienCT.Text!="")
			{
				if(int.Parse(cbobThamNienCT.Text)<0)
				{
					MessageBox.Show(lan.Change_language_MessageText("Nhập thăm niên công tác không hợp lệ"),lan.Change_language_MessageText("Thông Báo"));
					cbobThamNienCT.Focus();
					return false;
				}
			}
			if(cbobHeSoLuong.Text!="")
			{	
				if(cbobHeSoLuongDen.Text!="")
				{
					if(decimal.Parse(cbobHeSoLuong.Text)>decimal.Parse(cbobHeSoLuongDen.Text))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập hệ số lương <= đến"),lan.Change_language_MessageText("Thông Báo"));
						cbobHeSoLuong.Focus();
						return false;
					}	
				}
//				decimal l=0;
//				TinhhesoL(l,cbobHeSoLuong);
			}
			if(cbobHeSoLuongDen.Text!="")
			{
				if(cbobHeSoLuong.Text!="")
				{
					if(decimal.Parse(cbobHeSoLuong.Text)>decimal.Parse(cbobHeSoLuongDen.Text))
					{
						MessageBox.Show(lan.Change_language_MessageText("Nhập hệ số lương <= đến"),lan.Change_language_MessageText("Thông Báo"));
						cbobHeSoLuongDen.Focus();
						return false;
					}
				}
//				decimal l1=0;
//				TinhhesoL(l1,cbobHeSoLuongDen);
			}
			return true;					
		}
		private void txbTuoiTu_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8)
				e.Handled=false;						
		}

		private void txbTuoiDen_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void txbSinhTuThang_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void txbDenThang_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void cbobThamNienCT_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8)
				e.Handled=false;			
		}

		private void cbobHeSoLuong_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8 || e.KeyChar=='.')
			{
				e.Handled=false;				
			}		
		}

		private bool IsNumeric (string strNum)
		{	
			int iNum;
			try
			{
				iNum = int.Parse(strNum);
				return true;
			}
			catch
			{
				return false;
			}
		}
        
		private void cbobHeSoLuongDen_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if (!IsNumeric(e.KeyChar.ToString()))
				e.Handled=true;
			if(e.KeyChar==8 || e.KeyChar=='.')
			{
				e.Handled=false;							
			}			
		}

		private void TinhhesoL(decimal ld,TextBox txt)
		{
			ld=0;
			try
			{
				ld=decimal.Parse(txt.Text.Trim());
				txt.Text="";
				if(ld>0)
					txt.Text=ld.ToString("#.##");
			}
			catch
			{
				ld=0;
				txt.Text="";
			}
		}

		private void checklietsi_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void checktnxp_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void checkbdxn_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
	
			if(e.KeyCode ==Keys.Enter)
				checknghiviec.Focus();
		}

		private void checknghiviec_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				checklamviec.Focus();
		}

		private void checklamviec_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void checkrutgon_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				checkchitiet.Focus();
		}

		private void checkchitiet_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
            if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void cbochucdanh_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void cbotrinhdo_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if(e.KeyCode ==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void checknghiviec_CheckStateChanged(object sender, System.EventArgs e)
		{
			if(checknghiviec.Checked ==true)
				checklamviec.Checked =false;
		}

		private void checklamviec_CheckStateChanged(object sender, System.EventArgs e)
		{
			if(checklamviec.Checked ==true)
				checknghiviec.Checked =false;
		}

		private void checkrutgon_CheckStateChanged(object sender, System.EventArgs e)
		{
			if(checkrutgon.Checked ==true)
				checkchitiet.Checked =false;
		}

		private void checkchitiet_CheckStateChanged(object sender, System.EventArgs e)
		{
			if(checkchitiet.Checked ==true)
				checkrutgon.Checked =false;
		}

		
        private int songay(int sonam )
        {
            int daunam = 0,m=0,d=0,sngay=0;
            DateTime d1;
            daunam = DateTime.Now.Year - sonam;
            m = DateTime.Now.Month;
            d = DateTime.Now.Day;
            d1 = new DateTime(daunam, m, d);
            sngay = (int)(DateTime.Now.ToOADate() - d1.ToOADate());
            return sngay;
        }
        private void btnexel_Click(object sender, EventArgs e)
        {
            ExportToExcel exp = new ExportToExcel();
            DataSet dstmp = new DataSet();
            if (checkchitiet.Checked)
            {
                dstmp = exp_exel(ds);
                exp.exel_dsnhanvien(dstmp, "danh sach nhan vien");
            }
            else
            {
                print1 = new pPrint(f_m);
                print1.Print(mDB, ds, lan.Change_language_MessageText("DANH SÁCH CÁN BỘ CÔNG CHỨC"), "h_danhsachNV.rpt", true, 0);
            }
        }

       
	}
}
